<!DOCTYPE html>
<html>
<head>
    <title>WebSocket Client</title>
</head>
<body>
<script>
    // 替换为你的WebSocket服务器地址
    const socket = new WebSocket('ws://0.0.0.0:9004');

    socket.onopen = function(event) {
        console.log('Connection established');
        socket.send('Hello Server');
    };

    socket.onmessage = function(event) {
        console.log('Message from server: ', event.data);
    };

    socket.onclose = function(event) {
        console.log('Connection closed');
    };

    socket.onerror = function(error) {
        console.log('Error: ', error);
    };
</script>
</body>
</html>